interface ObjectWithKey {
    [key: string]: any;
}
// 去重处理
export const getUniqueArrayObjects = <T extends ObjectWithKey>(arr: T[], key: keyof T): T[] => {
    const uniqueObj: {[key: string]: boolean} = {};
    const uniqueArr: T[] = [];
    for (const obj of arr) {
        if (!uniqueObj[obj[key]]) {
            uniqueObj[obj[key]] = true;
            uniqueArr.push(obj);
        }
    }
    return uniqueArr;
};
